<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>Form Elements - Ace Admin</title>

<meta name="description" content="Common form elements and layouts" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<!-- bootstrap & fontawesome -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/font-awesome.min.css" />

<!-- page specific plugin styles -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/jquery-ui.custom.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/chosen.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-datepicker3.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-timepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/daterangepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-colorpicker.min.css" />


<!-- ace styles -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace.min.css"
	id="main-ace-style" />

<!--[if lte IE 9]>
			<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-part2.min.css" />
		<![endif]-->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-skins.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-rtl.min.css" />

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-ie.min.css" />
		<![endif]-->

<!-- inline styles related to this page -->

<!-- ace settings handler -->
<script
	src="<%=request.getContextPath()%>/ace/assets/js/ace-extra.min.js"></script>

<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="<%=request.getContextPath()%>/ace/assets/js/html5shiv.min.js"></script>
		<script src="<%=request.getContextPath()%>/ace/assets/js/respond.min.js"></script>
		<![endif]-->
		
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/static/jquery-validate/css/form.css" />
</head>

<body class="no-skin">


	<!-- /section:basics/content.breadcrumbs -->
	<div class="page-content">
		<!-- /section:settings.box -->
		<div class="page-content-area">
			<div class="page-header">
				<h1>生成会员卡</h1>
			</div>
			<!-- /.page-header -->

			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					<form id="drizzt-table" class="form-horizontal"
						action="<%=request.getContextPath()%>/bsbCardBatch/create"
						method="post">
						<!-- #section:elements.form -->


						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"> 数量 </label>

							<div class="col-sm-9">
								<input type="number"  placeholder="请输入会员卡数量" min="1"
									name="num" class="col-xs-10 col-sm-5" tip="请输入会员卡数量"/>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"> 选择事务所 </label>

							<div class="col-sm-9">
								<input type="hidden" name="firmId"  id="firmId"/>
								<input type="text" id="firmName" name="firmName" readonly="readonly"  class="col-xs-10 col-sm-5" />
								<a href="#my-modal" role="button" class="blue" data-toggle="modal">
									<i class="ace-icon fa fa-hand-o-up bigger-130"></i>选择 &nbsp;
								</a>

								<div id="my-modal" class="modal fade" tabindex="-1">
									<div class="modal-dialog">
										<div class="modal-content">
											<div class="modal-header">
												<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
												<h3 class="smaller lighter blue no-margin">选择一个事务所!</h3>
											</div>

											<div class="modal-body" id="selectFirm">
												<jsp:include page="selectFirm.jsp"></jsp:include>
											</div>

											<div class="modal-footer">
												<button class="btn btn-sm btn-danger pull-right" data-dismiss="modal">
													<i class="ace-icon fa fa-times"></i>
													关闭
												</button>
											</div>
										</div><!-- /.modal-content -->
									</div><!-- /.modal-dialog -->
								</div>
							</div>
									
						</div>

						<div class="clearfix form-actions">
							<div class="col-md-offset-3 col-md-9">
								<input class="btn btn-info" type="submit" value="生成编码" /> &nbsp;
								&nbsp; &nbsp; <input type="button" class="btn btn-info"
									onclick="location.href='<%=request.getContextPath()%>/bsbCardBatch/list.do'"
									value="返回" />
							</div>
						</div>
					</form>

					<!-- PAGE CONTENT ENDS -->
				</div>
				<!-- /.col -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.page-content-area -->
	</div>
	<!-- /.page-content -->
</body>

<!-- basic scripts -->

<!--[if !IE]> -->
<script type="text/javascript">
	window.jQuery
			|| document
					.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery-2.1.4.min.js'>"+ "<"+"/script>");
</script>

<!-- <![endif]-->

<script type="text/javascript">
	if ('ontouchstart' in document.documentElement)
		document.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery.mobile.custom.min.js'>"+ "<"+"/script>");
</script>

<script src="<%=request.getContextPath()%>/ace/assets/js/bootstrap.min.js"></script>
<script src="<%=request.getContextPath()%>/static/jquery-validate/js/jquery.validate.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/static/jquery-validate/js/jquery.validate.extend.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/static/jquery-validate/js/additional-methods.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/ace/assets/js/bootbox.js"></script>
<script type="text/javascript">
selectFirm(1);
function selectFirm(pageNum){
	$.ajax({
	    type: "GET",
	    url: "<%=request.getContextPath()%>/bsbFirm/selectlist",
	    data: {pageNum:pageNum},
	    dataType: "html",
	    success: function(data){
	               	$("#selectFirm").html(data);
	             },
	    fail: function(data){
	   	 alert(data)
	             }
	});
}
function goPage(pageNum){
	if(pageNum!=0){
		$("#pageNum").val(pageNum);
	}
	var myreg=/^[0-9]*$/;
	if(!myreg.test($("#pageNum").val())){
		alert("请输入有效数字！");
		$("#pageNum").val(1);
		return false;
	}
	selectFirm(pageNum);
}
function select(id,name){
	$("#firmId").val(id);
	$("#firmName").val(name);
	$("#my-modal").modal('hide');
}
</script>
<script type="text/javascript">
	  $().ready(function() {
		  $("#drizzt-table").validate({
		    rules: {
		    	num : {
		             required : true,
		             digits : true
		         },
		         firmId : {
		             required : true
		         },
		         firmName  : {
		        	 required : true
		         }
		   },
		         messages: {
		        	 num : {
		                 required : "请选择生成的数量",
		                 digits : "请输入正整数"
		             },
		            
		             firmId : {
		                 required : "请选择事务所"
		             },
		             firmName : {
		                 required : "请选择事务所"
		             }
		   }
			
		     });
		 });
	  </script>	  
</html>
